package com.autohammal.ui.frame;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ExpandBar;
import org.eclipse.swt.widgets.ExpandItem;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;

import swing2swt.layout.BorderLayout;

public class HammalConfigComposite extends Composite {

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public HammalConfigComposite(Composite parent, int style) {
		super(parent, style);
		RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
		rowLayout.fill = true;
		setLayout(rowLayout);
		
		Group grpMonitor = new Group(this, SWT.NONE);
		grpMonitor.setText("Monitor");
		grpMonitor.setLayout(new BorderLayout(0, 0));
		grpMonitor.setLayoutData(new RowData(338, 164));
		
		Composite composite = new Composite(grpMonitor, SWT.NONE);
		composite.setLayoutData(BorderLayout.NORTH);
		composite.setLayout(new RowLayout(SWT.HORIZONTAL));
		
		Label label = new Label(composite, SWT.NONE);
		label.setLayoutData(new RowData(54, 17));
		label.setText("Target");
		
		Combo combo = new Combo(composite, SWT.READ_ONLY);
		combo.setLayoutData(new RowData(224, SWT.DEFAULT));
		
		Group grpConfigTarget = new Group(grpMonitor, SWT.NONE);
		grpConfigTarget.setText("Config Target");
		grpConfigTarget.setLayoutData(BorderLayout.CENTER);
		grpConfigTarget.setLayout(new FillLayout(SWT.HORIZONTAL));
		
		CTabFolder tabFolder = new CTabFolder(grpConfigTarget, SWT.BORDER);
		tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
		
		CTabItem tbtmNewItem = new CTabItem(tabFolder, SWT.NONE);
		tbtmNewItem.setText("ConfigurationItem");
		
		Composite composite_1 = new Composite(tabFolder, SWT.NONE);
		tbtmNewItem.setControl(composite_1);
		
		CTabItem tbtmNewItem_1 = new CTabItem(tabFolder, SWT.NONE);
		tbtmNewItem_1.setText("InputItem");
		
		Composite composite_2 = new Composite(tabFolder, SWT.NONE);
		tbtmNewItem_1.setControl(composite_2);
		
		CTabItem tbtmNewItem_2 = new CTabItem(tabFolder, SWT.NONE);
		tbtmNewItem_2.setText("OutputItem");
		
		Composite composite_3 = new Composite(tabFolder, SWT.NONE);
		tbtmNewItem_2.setControl(composite_3);
		
		Group grpScheduler = new Group(this, SWT.NONE);
		grpScheduler.setText("Scheduler");
		grpScheduler.setLayout(new FillLayout(SWT.HORIZONTAL));
		grpScheduler.setLayoutData(new RowData(337, 100));
		
		CTabFolder tabFolder_1 = new CTabFolder(grpScheduler, SWT.BORDER);
		tabFolder_1.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
		
		CTabItem tbtmNewItem_3 = new CTabItem(tabFolder_1, SWT.NONE);
		tbtmNewItem_3.setText("Simple");
		
		CTabItem tbtmNewItem_4 = new CTabItem(tabFolder_1, SWT.NONE);
		tbtmNewItem_4.setText("Advance");
		
		CTabItem tbtmNewItem_5 = new CTabItem(tabFolder_1, SWT.NONE);
		tbtmNewItem_5.setText("WorkDay");
		
		ExpandBar expandBar = new ExpandBar(this, SWT.NONE);
		expandBar.setLayoutData(new RowData(SWT.DEFAULT, 120));
		
		ExpandItem xpndtmNewExpanditem = new ExpandItem(expandBar, SWT.NONE);
		xpndtmNewExpanditem.setExpanded(true);
		xpndtmNewExpanditem.setText("Options");
		
		CTabFolder tabFolder_2 = new CTabFolder(expandBar, SWT.BORDER);
		xpndtmNewExpanditem.setControl(tabFolder_2);
		tabFolder_2.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
		xpndtmNewExpanditem.setHeight(xpndtmNewExpanditem.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
		
		CTabItem tbtmNewItem_6 = new CTabItem(tabFolder_2, SWT.NONE);
		tbtmNewItem_6.setText("New Item");
		
		Composite composite_4 = new Composite(tabFolder_2, SWT.NONE);
		tbtmNewItem_6.setControl(composite_4);
		
		ExpandItem xpndtmNewExpanditem_1 = new ExpandItem(expandBar, SWT.NONE);
		xpndtmNewExpanditem_1.setText("New ExpandItem");

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}
}
